Changeset 14254


Ignore:
Timestamp:
Mar 16, 2014, 10:50:39 PM (8 years ago)
Author:
jordan
Message:

fix crash when creating the Open Torrent dialog in Qt 5.2 on Ubuntu 14.04

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r14225 r14254  
    11781178  b->setChecked (myPrefs.getBool (Prefs::OPTIONS_PROMPT));
    11791179  b->setObjectName (SHOW_OPTIONS_CHECKBOX_NAME);
    1180   QGridLayout * l = dynamic_cast<QGridLayout*> (d->layout ());
    1181   l->addWidget (b, l->rowCount (), 0, 1, -1, Qt::AlignLeft);
     1180  auto l = dynamic_cast<QGridLayout*> (d->layout ());
     1181  if (l == nullptr)
     1182    {
     1183      l = new QGridLayout;
     1184      d->setLayout (l);
     1185    }
     1186  l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft);
    11821187
    11831188  connect (d, SIGNAL (filesSelected (const QStringList&)),
     
    13201325  msgBox.setDefaultButton (QMessageBox::Cancel);
    13211326  msgBox.setIcon (QMessageBox::Question);
    1322   /* hack needed to keep the dialog from being too narrow */
    1323   QGridLayout* layout = (QGridLayout*)msgBox.layout ();
     1327  // hack needed to keep the dialog from being too narrow
     1328  auto layout = dynamic_cast<QGridLayout*>(msgBox.layout());
     1329  if (layout == nullptr)
     1330    {
     1331      layout = new QGridLayout;
     1332      msgBox.setLayout (layout);
     1333    }
    13241334  QSpacerItem* spacer = new QSpacerItem (450, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
    13251335  layout->addItem (spacer, layout->rowCount (), 0, 1, layout->columnCount ());
  • trunk/qt/qtr.pro

    r14163 r14254  
    1212man.files = transmission-qt.1
    1313
    14 CONFIG += qt thread debug link_pkgconfig
     14CONFIG += qt thread debug link_pkgconfig c++11
    1515QT += network dbus
    1616PKGCONFIG = fontconfig libcurl openssl libevent
Note: See TracChangeset for help on using the changeset viewer.