Permalink
Browse files

Adjust TimerDialog's size to content's size

  • Loading branch information...
hermit4 committed Nov 4, 2013
1 parent 4a72f7f commit 8fa8674b379c0ea149cb29618eb841c0db958009
Showing with 7 additions and 14 deletions.
  1. +5 −0 timerdialog.cpp
  2. +2 −2 timerdialog.h
  3. +0 −12 timerdialog.ui
View
@@ -19,11 +19,13 @@
#include "../KanmusuMemoryTwitter/twitterinfo.h"
#include <QQmlContext>
#include <QQuickItem>
#include <QtQml/QQmlEngine>
#include <QDateTime>
#include <QtCore/QDebug>
static const int DIALOG_MARGIN = 30;
TimerDialog::TimerDialog(QWidget *parent
, QSystemTrayIcon *trayIcon
@@ -76,6 +78,9 @@ void TimerDialog::showEvent(QShowEvent *event)
//QML設定して表示
m_viewer->setSource(QUrl("qrc:///qml/KanmusuMemory/timerDialog.qml"));
m_viewer->show();
QSize contentSize = m_viewer->rootObject()->childrenRect().toRect().size() + QSize(DIALOG_MARGIN,DIALOG_MARGIN);
setMinimumSize(contentSize);
setMaximumSize(contentSize);
}
}
View
@@ -49,8 +49,6 @@ public slots:
void timeout();
private:
Ui::TimerDialog *ui;
QtQuick2ApplicationViewer *m_viewer;
TimerData m_timerdata;
QTimer m_timer;
@@ -61,6 +59,8 @@ public slots:
OAuth m_oauth;
Status m_status;
Ui::TimerDialog *ui;
bool checkKanmemoTimerTimeout(qint64 settime, qint64 starttime);
void showTimerMessage(const QStringList &messages);
void tweetTimerMessage(const QStringList &messages);
View
@@ -10,18 +10,6 @@
<height>620</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>620</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>620</height>
</size>
</property>
<property name="windowTitle">
<string>Timer</string>
</property>

0 comments on commit 8fa8674

Please sign in to comment.